//
// Created by Arikes on 9/22/21.
//

#ifndef DESIGNERMODE_CONCRETEFLYWEIGHT_H
#define DESIGNERMODE_CONCRETEFLYWEIGHT_H

#include "Flyweight.h"
namespace FlyweightMode
{
    class ConcreteFlyweight:public Flyweight
    {
    public:
        ConcreteFlyweight(std::string key)
        {
            _key = key;
            std::cout<<"具体享元" << key << "被创建！"<<std::endl;
        }

        virtual void operation(UnsharedConcreteFlyweight state)
        {
            std::cout<<"具体享元" << _key << "被调用,非享元信息是:"<<state.getInfo()<<std::endl;
        }

    private:
        std::string _key = "";
    };
}

#endif //DESIGNERMODE_CONCRETEFLYWEIGHT_H
